<?php
/*----------------------------------------------------------------------
 * MVP(micro video platform)接口逻辑管理
 * Author: ming.nie
----------------------------------------------------------------------*/

namespace Common\Logic;

class MVPLogic
{
    /**
     * 获取影院设置
     * @param  array
     * @return array
     * @author ming.nie
     */
    public function getCinemaSetting($params)
    {
        $result = array();
        $result_manager = array(
            0 => array('status_code'=>0,'status_message'=>'获取影院信息失败'),
            1 => array('status_code'=>1,'status_message'=>'获取影院信息成功'),
            3 => array('status_code'=>3,'status_message'=>'参数错误'),
        );
        $status_code = 0;
        if(array_key_exists('host_name', $params)) {
            
            $commonLogic = new \Common\Logic\CommonLogic();
            //获取影院信息
            $remote_cinema_method_params = array();
            $remote_cinema_method_params['host_name'] = $params['host_name'];
            $remote_cinema_method_params['class'] = 'Common';
            $remote_cinema_method_params['method'] = 'getOtherSetting';
            $remote_cinema_method_params['method_params'] = array();
            $result = $commonLogic->getRemoteCinemaMethod($remote_cinema_method_params);
            if(1 == $result['status_code']) {
                $status_code = 1;
            }
        } else {
            $status_code = 3;
        }
        
        $result = array_merge($result,$result_manager[$status_code]);
        return $result;
    }
}